<include target="header.html" />
<load target="js/waiting.js" usecdn="true" />

<h2>{$package->title} ver. {$package->version}</h2>
<div cond="$contain_core" class="x_alert x_alert-block">
	<h4>{$lang->msg_update_core_title}</h4>
	<p>{$lang->msg_update_core}</p>
</div>
<div class="x_well">
	<p cond="$package->installed">{$lang->current_version}: {$package->cur_version} <block cond="$package->need_update">({$lang->require_update})</block></p>
	<p cond="!$package->installed">{$lang->require_installation}</p>
	<block cond="$package->depends">
		<p>{$lang->about_depending_programs}</p>
		<ul>
			<li loop="$package->depends => $dep">
				{$dep->title} ver. {$dep->version} -
				<block cond="$dep->installed">{$lang->current_version}: {$dep->cur_version} <block cond="$dep->need_update">({$lang->require_update})</block></block>
				<block cond="!$dep->installed">{$lang->require_installation}</block>
				<block cond="$show_ftp_note && ($dep->need_update || !$dep->installed)">
					<a href="{_XE_DOWNLOAD_SERVER_}?module=resourceapi&act=procResourceapiDownload&package_srl={$dep->package_srl}">{$lang->cmd_download}</a> ({$lang->path}: {$dep->path})
				</block>
			</li>
		</ul>
		<p>{$lang->description_install}</p>
	</block>
</div>

<block cond="!$package->installed || $package->need_update">
	<div cond="$show_ftp_note" class="x_well x_clearfix">
		<p>{$lang->description_download}. (<a href="{getUrl('', 'module', 'admin', 'act', 'dispAdminConfigFtp')}">FTP Setup</a>)</p>
		<p>{$lang->path}: {$package->path}</p>
		<p><a class="x_btn x_btn-primary x_pull-right" href="{_XE_DOWNLOAD_SERVER_}?module=resourceapi&act=procResourceapiDownload&package_srl={$package->package_srl}">{$lang->cmd_download}</a>
	</div>
	<div cond="!$show_ftp_note">
		<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/autoinstall/tpl/install/1'" class="message error">
			<p>{$XE_VALIDATOR_MESSAGE}</p>
		</div>
		<form action="./" class="x_form-horizontal" method="post" ruleset="ftp">
			<input type="hidden" name="module" value="autoinstall" />
			<input type="hidden" name="act" value="procAutoinstallAdminPackageinstall" />
			<input type="hidden" name="package_srl" value="{$package->package_srl}" />
			<input type="hidden" name="return_url" value="{$return_url}" />
			<input cond="!$need_password" type="hidden" name="ftp_password" value="dummy" />
			<input type="hidden" name="xe_validator_id" value="modules/autoinstall/tpl/install/1" />

			<block cond="$need_password">
				<div class="x_control-group">
					<label class="x_control-label" for="ftp_password">FTP {$lang->password}</label>
					<div class="x_controls">
						<input type="password" name="ftp_password" id="ftp_password" value="" />
						<p class="x_help-inline">{$lang->about_ftp_password}</p>
					</div>
				</div>
			</block>
			<div class="x_clearfix btnArea">
				<div class="x_pull-right">
					<input class="x_btn x_btn-primary" type="submit" value="{$package->installed?$lang->update:$lang->install}" />
				</div>
			</div>
		</form>
	</div>
</block>
